package com.itheima.Controller;

import com.itheima.pojo.Setmeal;
import com.itheima.service.SetmealService;
import com.itheima.support.Result;
import com.itheima.vo.SetmealVO;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/setmeal")
public class H5Controller {

    @Reference
    SetmealService setmealService;

    @GetMapping("/findAll")
    public Result findAll(){
        List<Setmeal> list = setmealService.findAll();
        return new Result(true,"查询全部套餐成功",list);
    }

    @GetMapping("/findSetMealDetail")
    public Result findSetMailDetail(Long id){

        SetmealVO setmealVO = setmealService.findSetMailDetail(id);
        System.out.println("下雨");
        return new Result(setmealVO);
    }
}
